<!doctype html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<title>服务通知的服务</title>
		<!-- css代码 start -->
		<link href="../../../css/mui.min.css" rel="stylesheet" />
		<link href="../../../css/global.css" rel="stylesheet" />
		<link href="../../../css/style.css" rel="stylesheet" />
		<link rel="stylesheet" href="../../../css/mui.picker.css">
		<link rel="stylesheet" href="../../../css/mui.poppicker.css">
		<!-- css代码 end -->
	</head>
	<body>
		<!-- html代码 start -->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 id="title" class="mui-title">服务通知的服务</h1>
		</header>
		<div class="mui-content"> 
			<div class="page_cen shadow title_num" id="dianji">服务通知编号：<span id="serviceNo" style="color: #ea1e1a;"></span></div>
			<div class="item_box" id="itemBox">
				
			</div>
		</div>
		<!-- html代码 end -->

		<!-- js代码 start -->

		<!-- 基础js start -->
		<script src="../../../js/mui.min.js"></script>
		<script src="../../../js/utils/h.js"></script>
		<script src="../../../js/constant.js"></script>
		<script src="../../../js/common.js"></script>
		<script src="../../../js/utils/base64.js"></script>
		<script src="../../../js/utils/md5.js"></script>
		<script src="../../../js/utils/sortMap.js"></script>
		<script src="../../../js/utils/http.js"></script>
		<script src="../../../js/app.js"></script>
		<!-- 基础js end -->

		<script type="text/javascript" charset="utf-8">
			var serviceNo;
			var serviceNoticeId;
			//var planId;
			
			(function($, doc) {
				var state;
				var stateName;
				
				$.init();

				$.plusReady(function() {
					// 从上一个页面取值
					var self = plus.webview.currentWebview();
					h('#serviceNo').html(self.serviceNo)
					
					serviceNo = self.serviceNo;
					serviceNoticeId = self.serviceNoticeId;
					//planId = self.planId;
					
					// console.log(self.serviceNo)
					ajaxGet(BASE_URL + "cc/PlanDetails/selectPlanDetailsList", {
						"serviceNo": self.serviceNo
					}, function(data) {
						console.log(JSON.stringify(data))
						if (data.code == 200) {
							if(data.data && data.data.length > 0){
								var str = '';
								 for(var c = 0;c<data.data.length;c++){
									var fseName = data.data[c].fseName==undefined?"":data.data[c].fseName;
									var acceptTime = data.data[c].acceptTime==undefined?"":data.data[c].acceptTime;
									var signInTime = data.data[c].signInTime==undefined?"":data.data[c].signInTime;
									var signOffTime = data.data[c].signOffTime==undefined?"":data.data[c].signOffTime;
									str += '<div class="item">';
									str += '<div class="text">';
									str += fseName;
									str += '<img src="../../../images/icon_33.png" />'
									str += '<span style="width:100px;">工程师名称：</span> ';
									str += '</div>';
									
									str += '<div class="text">';
									str += acceptTime;
									str += '<img src="../../../images/icon_35.png" />'
									str += '<span style="width:100px;">接受时间：</span> ';
									str += '</div>';
									
									str += '<div class="text">';
									str += signInTime;
									str += '<img src="../../../images/icon_35.png" />'
									str += '<span style="width:100px;">签到时间：</span> ';
									str += '</div>';
									
									str += '<div class="text">';
									str += signOffTime;
									str += '<img src="../../../images/icon_35.png" />'
									str += '<span style="width:100px;">签离时间：</span> ';
									str += '</div>';
									
									str += '<div class="text">';
									//默认0待接受，1已接受，2已签到，3已签离，4已完成,5自动签离，6已拒绝
									state = data.data[c].state;
									if(state == '0'){
										stateName = "待接受";
									}else if(state == '1'){
										stateName = "已接受";
									}else if(state == '2'){
										stateName = "已签到";
									}else if(state == '3'){
										stateName = "已签离";
									}else if(state == '4'){
										stateName = "已完成";
									}else if(state == '5'){
										stateName = "自动签离";
									}else if(state == '6'){
										stateName = "已拒绝";
									}
									
									str += stateName;
									str += '<img src="../../../images/icon_34.png" />'
									str += '<span>状态：</span> ';
									str += '</div>';
									str += '</div>';
								 }
								 h('#itemBox').html(str);
							}
						}else{
							app.toast(data.msg)
						}
					}, function(errorMsg) {
						app.toast("数据获取失败，请检查网络连接");
					});
					
					h("#dianji").tap(function(){
						app.jumpTo("/view/service/accept/detailsView.html", "view/service/accept/detailsView.html",
						{
							serviceNo: serviceNo,
							ServiceNoticeId: serviceNoticeId
						});
					})
					
				});
			}(mui, document));
		</script>
		<!-- js代码 end -->
	</body>
</html>
